/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package entidades;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author cegarciaa
 */
@Entity
@Table(name = "valores_1hr")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Valores1hr.findAll", query = "SELECT v FROM Valores1hr v"),
    @NamedQuery(name = "Valores1hr.findById", query = "SELECT v FROM Valores1hr v WHERE v.id = :id"),
    @NamedQuery(name = "Valores1hr.findByValor", query = "SELECT v FROM Valores1hr v WHERE v.valor = :valor"),
    @NamedQuery(name = "Valores1hr.findByFecha", query = "SELECT v FROM Valores1hr v WHERE v.fecha = :fecha")})
public class Valores1hr implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "Valor")
    private Float valor;
    @Column(name = "FECHA")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecha;
    @JoinColumns({
        @JoinColumn(name = "se\u00f1ales_equipo_id", referencedColumnName = "Equipos_id"),
        @JoinColumn(name = "se\u00f1ales_id", referencedColumnName = "id")})
    @ManyToOne(optional = false)
    private Señales señales;

    public Valores1hr() {
    }

    public Valores1hr(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Float getValor() {
        return valor;
    }

    public void setValor(Float valor) {
        this.valor = valor;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public Señales getSeñales() {
        return señales;
    }

    public void setSeñales(Señales señales) {
        this.señales = señales;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Valores1hr)) {
            return false;
        }
        Valores1hr other = (Valores1hr) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "enties.Valores1hr[ id=" + id + " ]";
    }
    
}
